package com.yst.metho.web.application.pointage;

import java.util.Calendar;

import javax.ejb.CreateException;
import javax.ejb.FinderException;
import javax.naming.NamingException;

import nextapp.echo2.app.event.ActionEvent;

import com.yst.metho.web.application.SuiviProdApp;
import com.yst.metho.web.application.interfaces.IItemViewWeb;
import com.yst.metho.web.application.utils.ExceptionMgt;
import com.yst.suivi.data.rights.Right;

public class PointageView extends IItemViewWeb
{
	public PointageView()
	{
		super(Right.VIEW_POINTAGE);
	}

	public void actionPerformed(ActionEvent arg0)
	{
		try
		{
			PointageViewPane pointagePane = new PointageViewPane(Calendar.getInstance());
			SuiviProdApp.getApp().changeWorkingArea(pointagePane);
		}
		catch (FinderException e)
		{
			ExceptionMgt.manage(e);
		}
		catch (NamingException e)
		{
			ExceptionMgt.manage(e);
		}
		catch (CreateException e)
		{
			ExceptionMgt.manage(e);
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yst.metho.web.application.interfaces.IItemViewWeb#getCategory()
	 */
	public String getCategory()
	{
		return "Mon espace";
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yst.metho.web.application.interfaces.IItemViewWeb#getName()
	 */
	public String getName()
	{
		return "Pointage";
	}

}
